﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AgileLogistics.View.Meishi.Partial
{
    /// <summary>
    /// PollTwo.xaml 的交互逻辑
    /// </summary>
    public partial class PollTwo : UserControl
    {
        public PollTwo()
        {
            InitializeComponent();
            vm = this.DataContext as ViewModel.PollViewModel;
        }

        ViewModel.PollViewModel vm;
        private void bt_remove_Click(object sender, RoutedEventArgs e)
        {
            var item = (sender as Button).Tag as Model.PollItem;
            vm.ZhucaiMenu.Remove(item);
            vm.ZhushiMenu.Remove(item);
            vm.TangMenu.Remove(item);
        }

        private void btn_AddZhuCai_Click(object sender, RoutedEventArgs e)
        {
            vm.ClassID = 2;
            HandyControl.Controls.Dialog.Show(new View.Meishi.Partial.Dialog());  
        }

        private void btn_AddZhushi_Click(object sender, RoutedEventArgs e)
        {
            vm.ClassID = 3;
            HandyControl.Controls.Dialog.Show(new View.Meishi.Partial.Dialog()); ;
        }

       

        private void btn_AddTang_Click(object sender, RoutedEventArgs e)
        {
            vm.ClassID = 4;
            HandyControl.Controls.Dialog.Show(new View.Meishi.Partial.Dialog()); ;

        }
    }
}
